package com.lei.impl;

import com.lei.CacheService;
import com.lei.RedisUtils;

import java.util.concurrent.TimeUnit;

/**
 * @author: leiGer
 * @Date: 2022/01/15
 * @Time: 16:46
 */
public class CacheServiceImpl implements CacheService {
    private RedisUtils redis = new RedisUtils();
    @Override
    public String get(String key) {
        return redis.get(key);
    }

    @Override
    public void set(String key, String val) {
        redis.set(key,val);
    }

    @Override
    public void set(String key, String val, long timeout, TimeUnit timeUnit) {
        redis.set(key,val,timeout,timeUnit);
    }

    @Override
    public void del(String key) {
        redis.del(key);
    }
}
